package com.xcrj.java8.datetime;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Test {
    public static void main(String[] args) {
        format();
    }

    //日期时间格式化输出
    public static void format(){
        LocalDateTime now=LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-M-dd HH:mm:ss");
        System.out.println(formatter.format(now));
    }
}
